The Point object contains the following methods:
The GetAttribute method returns a specified point attribute.
GetAttribute(attrIdAsStringorEnum As Variant) As Variant
| Parameter | Required | Description |
|---|---|---|
|
attrIdAsStringorEnum |
Yes |
A variant value (either a string or an enumeration) indicating the attribute to return. The enumeration table is "Enum CxScriptPointAttributes." |
The string name or enumeration value of an attribute can be used as the attrIdAsStringorEnum. See the CxScript Enumeration Attributes table in the Enumeration Constants section.
Example
The following function returns the point description for a given point tag using the Description attribute (0).
|
Function GetPointDescription (tagString) Dim objPoint
Set objPoint = Points.Point(tagString) GetPointDescription = objPoint.GetAttribute("Description") End Function |
The GetAttributeName method returns an attribute name based on an attribute ID number.
GetAttributeName(attrID As Long) As Variant
| Parameter | Required | Description |
|---|---|---|
|
attrId |
Yes |
The ID of the attribute. Attributes are listed in "Enum CxScriptPointAttributes." |
A typical use of this function is looping through a set of attributes by ID and displaying the attribute name with its value for a particular tag. See the CxScript Enumeration Attributes table in the Enumeration Constants section.
Example
The following function loops through the first seven point attributes for a PSTATIC point and displays each value in a list box.
|
Sub ShowPointAttributes () Dim objPoint, strAttrName, strLine lstFacilities.ResetContent
'Create a point object based on the facility/UDC tag string Set objPoint = Points.Point("CYGDEMO.UIS::METER206.PSTATIC")
For i = 0 To 6 strAttrName = objPoint.GetAttributeName(i) objPoint.GetAttribute(i) lstFacilities.AddString strLine Next End Sub |